package com.amarsoft.are.lang;

import java.io.Serializable;

public class SimpleElement
  implements Element, Serializable
{
  private static final long serialVersionUID = 1L;
  private String name = null;
  private String label = null;
  private Object value = null;
  private String id = null;
  private static long idCount = 0L;

  public SimpleElement()
  {
  }

  public SimpleElement(String paramString)
  {
    this.name = paramString;
  }

  public SimpleElement(String paramString1, String paramString2)
  {
    this.name = paramString1;
    this.label = paramString2;
  }

  public String getId()
  {
    if (this.id == null)
      this.id = String.valueOf(idCount++);
    return this.id;
  }

  public String getName()
  {
    return ((this.name == null) ? getId() : this.name);
  }

  public void setName(String paramString)
  {
    this.name = paramString;
  }

  public String getLabel()
  {
    return ((this.label == null) ? getName() : this.label);
  }

  public void setLabel(String paramString)
  {
    this.label = paramString;
  }

  public Object getValue()
  {
    return this.value;
  }

  public void setValue(Object paramObject)
  {
    this.value = paramObject;
  }

  public boolean isNull()
  {
    return (this.value == null);
  }

  public void setNull()
  {
    this.value = null;
  }
}